import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import App from './App.vue';
import axios from 'axios';
import router from './router';
import NProgress from "nprogress";
import "nprogress/nprogress.css";
axios.defaults.baseURL = import.meta.env.VITE_APP_URL;
axios.interceptors.request.use((config) => {
    // 将token数据添加到请求头
    config.headers.Authorization = window.sessionStorage.getItem("token");
    // 开启进度条
    NProgress.start();
    return config;
});
axios.interceptors.response.use((config) => {
    // 关闭进度条
    NProgress.done();
    return config;
})
const app = createApp(App);
app.use(ElementPlus);
app.use(router);
app.mount('#app');
